package com.simas.common;

import net.rim.device.api.ui.MenuItem;
import net.rim.device.api.ui.UiApplication;
import net.rim.device.api.ui.component.Dialog;
import net.rim.device.api.ui.container.MainScreen;

import com.simas.screen.WelcomeScreen;

public class CommonMenu {
	MainScreen screen;

	public CommonMenu() {
		
	}
	
	public CommonMenu(MainScreen mainScreen) {
		this.screen = mainScreen;
	}
	
	public MenuItem _closeItem = new MenuItem("Close", 200000, 10) {
        public void run() {
            onClose();
       }
    };
    
    public boolean onClose() {
        Dialog.alert("Terima Kasih");
        System.exit(0);
        return true;
    }
    
    public MenuItem _welcomeScreen = new MenuItem("Close", 200000, 10) {
        public void run() {
            welcomeScreen();
       }
    };
    
    public boolean welcomeScreen() {
    	UiApplication.getUiApplication().popScreen(screen);
		WelcomeScreen nms = new WelcomeScreen( );
		UiApplication.getUiApplication().pushScreen(nms);
        return true;
    }
}
